﻿package cn.antscript.airCMS.data 
{
	import cn.antscript.airCMS.data.singleData.ImgData;
	/**
	 * ...
	 * @author 
	 */
	public class ImgsData implements IGroupBtn
	{
		public var allowDel:Boolean;
		public var container:Vector.<ImgData>;
		public var label:String;
		public function ImgsData(xml:XML) 
		{
			
			//<imgs label="" allowDel="">
				//<img label="" txt="" url="" timestamp="" fixed="" width="" height="" />
				//<img label="" txt="" url="" timestamp="" fixed="" width="" height="" />
				//<img label="" txt="" url="" timestamp="" fixed="" width="" height="" />
			//</imgs>
			
			allowDel = String(xml.@allowDel) == "1";
			label = String(xml.@label);
			var data:ImgData;
			container = new Vector.<ImgData>();
			for (var i:int = 0; i < xml.img.length(); i++) 
			{
				data = new ImgData(	String(xml.img[i].@id),
										String(xml.img[i].@label),
										String(xml.img[i].@content),
										String(xml.img[i].@url),
										String(xml.img[i].@timestamp),
										String(xml.img[i].@thumb),										
										String(xml.img[i].@fixed)=="1",
										int(String(xml.img[i].@width)),
										int(String(xml.img[i].@height)));
										
				container.push(data);
			}
		
		}
		
	}

}